﻿/** *  * Twin Sound Module *  * @author Richard Rodney * @version 0.1 */package railk.as3.motion.modules {	import flash.media.SoundTransform;	import railk.as3.motion.utils.Prop;	public class SoundModule {		static public function update( target:Object, props:Prop, ratio:Number ):Prop {			if( props.type == 'pan') target.soundTransform = props.current = pan( ratio, props.start, props.end, target.soundTransform.volume );			else if( props.type == 'volume') target.soundTransform  = props.current = volume( ratio, props.start, props.end, target.soundTransform.pan );			return props;		}				static private function volume( n:Number, bv:Number, ev:Number, p:Number ):SoundTransform { return new SoundTransform(ev-(1-n),p); }		static private function pan( n:Number, bp:Number, ep:Number, v:Number ):SoundTransform { return new SoundTransform(v,ep-(1-n)); }	}}